
package org.puremvc.as3.multicore.demos.flex.hellopipes.modules.simplemodule.controller
{

    import org.puremvc.as3.multicore.demos.flex.hellopipes.modules.simplemodule.model.MessagesProxy;
    import org.puremvc.as3.multicore.demos.flex.hellopipes.modules.simplemodule.view.SimpleModuleJunctionMediator;
    import org.puremvc.as3.multicore.demos.flex.hellopipes.modules.simplemodule.view.SimpleModuleMediator;
    import org.puremvc.as3.multicore.interfaces.ICommand;
    import org.puremvc.as3.multicore.interfaces.INotification;
    import org.puremvc.as3.multicore.patterns.command.SimpleCommand;

	/**
	 * Startup the SimpleModule
	 */
    public class StartupCommand extends SimpleCommand implements ICommand
    {
        override public function execute(note:INotification):void
        {
        	//
			// Create and Register the SimpleModule Junction and its Mediator
 			facade.registerMediator( new SimpleModuleJunctionMediator() );
			//
			// Create and Register the Module and its Mediator
	       	var app: SimpleModule = note.getBody() as SimpleModule;
       		facade.registerMediator( new SimpleModuleMediator( app ) );
       		//
       		// register proxy
       		facade.registerProxy( new MessagesProxy() );
       		
        }
        
    }
}